use Dosvid
go

if exists(select 1
		  from sysobjects
		  where name = 'Candidat_Phones')
  drop table Candidat_Phones
go

create table Candidat_Phones
(
  Id int identity(1,1) not null,
  CandidatID int not null,
  Phone nvarchar(13) not null
)  
go

alter table Candidat_Phones add constraint PK_Candidat_Phones_ID primary key(Id) 
go


alter table Candidat_Phones add constraint FK_Candidat_Phones_Candidates_CandidatID 
      foreign key (CandidatID) references Candidates(Id) on delete cascade
go


create nonclustered index IX_Candidat_Phones_CandidatId on Candidat_Phones
       (CandidatID asc)
go
